<?php echo $this->Form->create('Paginate', array('id' => 'paginate', 'url' => $this->request->here(false), 'type' => 'post', 'inputDefaults' => array('label' => false))); ?>           				
<div id="content-header">
<h1>User Management</h1>
</div>
<div id="breadcrumb">
	<a href="<?php echo $this->Html->url('/admin/')?>" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a>
	<a href="#" class="current">List User</a>
</div>
<div class="container-fluid">
<div class="row-fluid">
	<div class="span12">	
                <?php
            echo $this->element('toolbar');
            ?>	
            							
		<div class="widget-box">
			<div class="widget-title">
				<span class="icon">
					<i class="icon-th"></i>
				</span>
				<h5>List of content</h5>
			</div>
			<div class="widget-content widget-content-two">
				<div class="wd-select">
					<div class="control-group">
						<div class="controls wd-farming">
							<select>
								<option />Delete
							</select>
							<button class="btn">Apply</button>
<!--
							<select>
								<option />Show all date
								<option />Second option Bulk Actions
								<option />Third option
								<option />Fourth option
								<option />Fifth option
								<option />Sixth option
								<option />Seventh option
								<option />Eighth option
							</select>
							<select>
								<option />View all categories
								<option />Second option Bulk Actions
								<option />Third option
								<option />Fourth option
								<option />Fifth option
								<option />Sixth option
								<option />Seventh option
								<option />Eighth option
							</select>
							<button class="btn">Filter</button>
-->
						</div>
					</div>
				</div>
				<table class="table table-bordered data-table table-striped with-check wd-hover-btn">
					<thead>
						<tr>
                            <th><?php echo  __d('system', 'Id'); ?>      </th>
                            <th> <?php echo  __d('system', 'Username'); ?></th>
                            <th> <?php echo  __d('system', 'Fullname'); ?></th>
                            <th> <?php echo  __d('system', 'Email'); ?></th>
                            <th> <?php echo  __d('system', 'Created'); ?></th>
                            <th>  <?php echo  __d('system', 'Updated'); ?></th>
                            <th class="wd-fix-width-1"><?php echo  __d('system', 'Action'); ?></th>
						</tr>
					</thead>
					<tbody>
             <?php
                        
                            $defaultLanguage = Router::defaultLanguage();
                          $_queries = array('continue' => $this->request->here(false));
                            ?>                    
                    <?php foreach ($users as $user) : ?>
							<tr>
                		<td><input type="checkbox" /></td>            
                        <?php if (isset($_displayFields['username'])): ?>       
  	                         <td>
                           <?php echo  $user['User']['username']; ?>
                           </td>
                               <?php endif; ?>
                        <?php if (isset($_displayFields['fullname'])): ?>       
  	                         <td>
                          <?php echo $user['User']['fullname']; ?>
                           </td>
                               <?php endif; ?>
                        <?php if (isset($_displayFields['email'])): ?>       
  	                         <td>
                           <?php echo  $user['User']['email']; ?>
                           </td>
                               <?php endif; ?>                               
                        <?php if (isset($_displayFields['created'])): ?>       
  	                         <td>
                             <?php echo date("d-m-Y",$user['User']['created']); ?>
                           </td>
                        <?php endif; ?>
                        <?php if (isset($_displayFields['updated'])): ?>       
  	                         <td>
                          <?php echo date("d-m-Y",$user['User']['updated']); ?>
                           </td>
                        <?php endif; ?>                                                        
					   <td>
							<ul class="wd-link-control">
							<li><a href="<?php echo $this->Html->url(array('plugin'=>'user','controller' => 'user', 'action' => 'edit', $user['User']['id'], '?' => $_queries));?>" class="btn btn-mini"><i class="icon-edit"></i> Edit</a></li>

							<li><a href="#<?php echo $user['User']['id']?>" data-toggle="modal" class="btn btn-mini"><i class="icon-remove"></i> Delete</a></li>
                 
    					   </ul>
		              </td>
						</tr>
                                                      
           <?php endforeach?>                        
					</tbody>
            <?php foreach ($users as $user) : ?>
				<div id="<?php echo $user['User']['id']?>" class="modal hide">
					<div class="modal-header">
						<button data-dismiss="modal" class="close" type="button">×</button>
						<h3>Alert modal</h3>
					</div>
					<div class="modal-body">
						<p>Are you sure delete “<?php echo $user['User']['username']?>”?</p>
					</div>
					<div class="modal-footer">
						<a data-dismiss="modal" class="btn" href="#">Cancel</a>
                        <?php echo $this->Html->link('Delete', array('plugin'=>'user','controller' => 'user','action' => 'delete', '?' => array_merge($_queries, array('keys' => array($user['User']['id'])))), array('title' => false, 'class' => 'btn btn-danger','data-dismiss='=>'modal')); ?>                        
					</div>
				</div>   
                <?php endforeach?>                  
				</table>

				<div class="wd-select">
                
					<div class="control-group">
						<div class="controls wd-farming">
							<select>
								<option />Delete
							</select>
							<button class="btn">Apply</button>
						</div>
					</div>
				</div>								
			</div>
		</div>
	</div>	
</div>
<?php         
echo $this->Form->hidden('task', array('id' => 'task', 'value' => ''));
echo $this->Form->end();
?>